import config
import requests
class Deptapi:
    #
    def get_dept_list(self,token):
        return requests.get(url=f"{config.url1}/api/company/department",headers={"Authorization":token})

    def insert_dept(self,token,json_data):
        return requests.post(url=f"{config.url1}/api/company/department", headers={"Authorization":token},json=json_data)

    def select_dept(self,token,id):
        return requests.get(url=f"{config.url1}/api/company/department/{id}", headers={"Authorization":token})

    def update_dept(self,token,id,json_data2):
        return requests.put(url=f"{config.url1}/api/company/department/{id}", headers={"Authorization":token},json=json_data2)

    def delect_dept(self,token,id):
        return requests.delete(url=f"{config.url1}/api/company/department/{id}", headers={"Authorization":token})
